<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.io.*,java.util.*"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%@page import="pos.domain.EventStore"%>
<%@page import="pos.domain.EntityStore"%>
<%@page import="pos.domain.RelationStore"%>
<%@page import="pos.domain.Event"%>
<%@page import="pos.domain.Entity"%>
<%@page import="pos.domain.Relation"%>
<%@page import="pos.domain.Category"%>
<%@page import="pos.domain.Discipline"%>
<%@page import="pos.domain.Type"%>
<%@page import="pos.domain.SubType"%>


<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Events included</title>
<script type="text/javascript">
	function redirection() {
		window.location = "index.html";
	}
</script>
</head>
<body>
	<div id="menu">
		<ul>
			<li><a href="javascript:redirection()">Entry page</a></li>

		</ul>
	</div>
	<table>
		<%
			EventStore store = EventStore.getInstance();
			List<Event> list = store.getEvents();
			for (Event e : list) {
				String title = e.getTitle();
				String description = e.getDescription();
				String origText = e.getOriginalText();
				String translText = e.getTranslatedText();
				String url = e.getUrlEvent();
				EntityStore entStore = EntityStore.getInstance();
				RelationStore relStore = RelationStore.getInstance();

				List<Entity> listEnt = e.getListEntities();
				List<Relation> listRel = e.getListRelations();
		%>
		<TR>
			<td>
				<%
					out.println("========= EVENT ========= ");
				%>
			</td>
		</TR>
		<TR>
			<td>
				<%
					out.println("Title: " + title);
				%>
			</td>
		</TR>
		<TR>
			<td>
				<%
					out.println("Description: " + description);
				%>
			</td>
		</TR>

		<TR>
			<td>
				<%
					out.println("\nUrl: " + url);
				%>
			</td>
		</TR>
		<TR>
			<td>
				<%
					out.println("\nRelations === ");
				%>
			</td>
		</TR>
		<%
			for (Relation r : listRel) {
		%>
		<TR>
			<td>
				<%
					out.println("\n" + r.getSubject() + " " + " " + r.getVerb()
									+ " " + r.getObject() + " "+ r.getUri());
				%>
			</td>
		</TR>
		<%
			}
		%>
		<tr>
			<td>
				<%
					out.println("\n\nEntities: ===");
				%>
			</td>
		</TR>

		<%
			for (Entity ent : listEnt) {
					List<String> listRDF = ent.getListRDFLinks();
					List<SubType> listSub = ent.getListSubType();
		%>
		<TR>
			<td >
				<%
					out.println("\nName: " + ent.getName());
				%>
			</td>
			<td>
				<%
					out.println(". Type: " + ent.getType().getName());
				%>
			</td>
		<%
			for (SubType st : listSub) {
		%>
		<TR>
			<td>
				<%
					out.println("SubType: " + st.getName());
				%>
			</td>
		</TR>
		<%
			}
					for (String s : listRDF) {
		%>
		<TR>
			<td>
				<%
					out.println("RDF Link: " + s);
				%>
			</td>
		</TR>
		<%
			}
		%>
		
		<%
		
			}
		%>
		<TR>
			<td>
				<%
					out.println("========== END EVENT");
				%>
			</td>
		</TR>
		<TR>
			<td></td>
		</TR>
	<%
		}
	%>
	</table>




</body>
</html>